package com.finance.action.android;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.finance.entity.customer.CallRecordInfo;
import com.finance.entity.customer.JingdongConsumption;
import com.finance.entity.customer.TaobaoConsumption;
import com.finance.entity.customer.UserInfo;
import com.finance.service.customer.CallRecordInfoService;
import com.finance.service.customer.JingdongConsumptionService;
import com.finance.service.customer.TaobaoConsumptionService;
import com.finance.service.customer.UserInfoService;

@Controller("CreditAction")
public class CreditAction {
	
	@Resource(name = "UserInfoService")
	private UserInfoService userInfoService;
	
	@Resource(name = "TaobaoConsumptionService")
	private TaobaoConsumptionService taobaoConsumptionService;
	
	@Resource(name = "JingdongConsumptionService")
	private JingdongConsumptionService jingdongConsumptionService;
	
	@Resource(name = "CallRecordInfoService")
	private CallRecordInfoService callRecordInfoService;
	
	@RequestMapping("user_info.htm")
	public String user_info(String kfUserId,ModelMap model){
		UserInfo userInfo = userInfoService.selectByPrimaryKey(kfUserId);//客户信息
		List<TaobaoConsumption> taobaoConsumption = taobaoConsumptionService.findByList(kfUserId);//淘宝
		List<JingdongConsumption> jingdongConsumptions = jingdongConsumptionService.findByList(kfUserId);//京东
		List<CallRecordInfo> callRecordInfos = callRecordInfoService.findByList(kfUserId);//通话记录
		model.addAttribute("userInfo", userInfo);
		model.addAttribute("taobaoConsumption", taobaoConsumption);
		model.addAttribute("jingdongConsumptions", jingdongConsumptions);
		model.addAttribute("callRecordInfos", callRecordInfos);
		return "front/kh_info";
	}

}
